home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1995 February: Tool Chest / Dev.CD Feb 95 / Dev.CD Feb 95.toast / Tool Chest / Interfaces / Universal Interfaces 2.0a3 / Universal AIncludes / Menus.a < prev    next >
Encoding:
Text File  |  1994-11-11  |  6.8 KB  |  405 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        Menus.a
  3. ;
  4. ;    Copyright:    © 1984-1994 by Apple Computer, Inc.
  5. ;                All rights reserved.
  6. ;
  7. ;    Version:    Universal Interfaces 2.0a3  ETO #16, MPW prerelease.  Friday, November 11, 1994. 
  8. ;
  9. ;    Bugs?:        If you find a problem with this file, send the file and version
  10. ;                information (from above) and the problem description to:
  11. ;
  12. ;                    Internet:    apple.bugs@applelink.apple.com
  13. ;                    AppleLink:    APPLE.BUGS
  14. ;
  15. ;
  16.  
  17.     IF &TYPE('__MENUS__') = 'UNDEFINED' THEN
  18. __MENUS__ SET 1
  19.  
  20.  
  21.     IF &TYPE('__MEMORY__') = 'UNDEFINED' THEN
  22.     include 'Memory.a'
  23.     ENDIF
  24. ;        include 'Types.a'                                            ;
  25. ;            include 'ConditionalMacros.a'                            ;
  26. ;        include 'MixedMode.a'                                        ;
  27.  
  28.     IF &TYPE('__QUICKDRAW__') = 'UNDEFINED' THEN
  29.     include 'Quickdraw.a'
  30.     ENDIF
  31. ;        include 'QuickdrawText.a'                                    ;
  32.  
  33.     IF &TYPE('__EVENTS__') = 'UNDEFINED' THEN
  34.     include 'Events.a'
  35.     ENDIF
  36. ;        include 'OSUtils.a'                                        ;
  37.  
  38. noMark                            EQU        0                    ;mark symbol for MarkItem
  39. ; menu defProc messages 
  40. mDrawMsg                        EQU        0
  41. mChooseMsg                        EQU        1
  42. mSizeMsg                        EQU        2
  43. mDrawItemMsg                    EQU        4
  44. mCalcItemMsg                    EQU        5
  45. textMenuProc                    EQU        0
  46. hMenuCmd                        EQU        27                    ;itemCmd == 0x001B ==> hierarchical menu
  47. hierMenu                        EQU        -1                    ;a hierarchical menu - for InsertMenu call
  48. mPopUpMsg                        EQU        3                    ;menu defProc messages - place yourself
  49. mctAllItems                        EQU        -98                    ;search for all Items for the given ID
  50. mctLastIDIndic                    EQU        -99                    ;last color table entry has this in ID field
  51.  
  52.     IF &TYPE('STRICT_MENUS') = 'UNDEFINED' THEN
  53.     STRICT_MENUS: SET 0
  54.     ENDIF
  55.     IF STRICT_MENUS  THEN
  56.     ELSE
  57. MenuInfo                 RECORD    0
  58. menuID                     ds.w    1
  59. menuWidth                 ds.w    1
  60. menuHeight                 ds.w    1
  61. menuProc                 ds.l    1
  62. enableFlags                 ds.l    1
  63. menuData                 ds.l    64
  64. sizeof                     EQU    270
  65.                         ENDR
  66.  
  67.     ENDIF
  68. MCEntry                 RECORD    0
  69. mctID                     ds.w    1                                    ;menu ID.  ID = 0 is the menu bar
  70. mctItem                     ds.w    1                                    ;menu Item. Item = 0 is a title
  71. mctRGB1                     ds        RGBColor                            ;usage depends on ID and Item
  72. mctRGB2                     ds        RGBColor                            ;usage depends on ID and Item
  73. mctRGB3                     ds        RGBColor                            ;usage depends on ID and Item
  74. mctRGB4                     ds        RGBColor                            ;usage depends on ID and Item
  75. mctReserved                 ds.w    1                                    ;reserved for internal use
  76. sizeof                     EQU    30
  77.                         ENDR
  78.  
  79. MenuCRsrc                 RECORD    0
  80. numEntries                 ds.w    1                                    ;number of entries
  81. mcEntryRecs                 ds.w    15                                ;ARRAY [1..numEntries] of MCEntry
  82. sizeof                     EQU    32
  83.                         ENDR
  84.  
  85.     IF GENERATING68K THEN
  86.         Macro
  87.         GetMBarHeight
  88.             move.W $0BAA,(sp)
  89.         EndM
  90.     ELSE
  91.         IMPORT    GetMBarHeight
  92.     ENDIF
  93.  
  94.     IF GENERATING68K THEN
  95.         _InitMenus:    OPWORD    $A930
  96.     ELSE
  97.         IMPORT    InitMenus
  98.     ENDIF
  99.  
  100.     IF GENERATING68K THEN
  101.         _NewMenu:    OPWORD    $A931
  102.     ELSE
  103.         IMPORT    NewMenu
  104.     ENDIF
  105.  
  106.     IF GENERATING68K THEN
  107.         _GetMenu:    OPWORD    $A9BF
  108.     ELSE
  109.         IMPORT    GetMenu
  110.     ENDIF
  111.  
  112.     IF GENERATING68K THEN
  113.         _DisposeMenu:    OPWORD    $A932
  114.     ELSE
  115.         IMPORT    DisposeMenu
  116.     ENDIF
  117.  
  118.     IF GENERATING68K THEN
  119.         _AppendMenu:    OPWORD    $A933
  120.     ELSE
  121.         IMPORT    AppendMenu
  122.     ENDIF
  123.  
  124.     IF GENERATING68K THEN
  125.         _AppendResMenu:    OPWORD    $A94D
  126.     ELSE
  127.         IMPORT    AppendResMenu
  128.     ENDIF
  129.  
  130.     IF GENERATING68K THEN
  131.         _InsertResMenu:    OPWORD    $A951
  132.     ELSE
  133.         IMPORT    InsertResMenu
  134.     ENDIF
  135.  
  136.     IF GENERATING68K THEN
  137.         _InsertMenu:    OPWORD    $A935
  138.     ELSE
  139.         IMPORT    InsertMenu
  140.     ENDIF
  141.  
  142.     IF GENERATING68K THEN
  143.         _DrawMenuBar:    OPWORD    $A937
  144.     ELSE
  145.         IMPORT    DrawMenuBar
  146.     ENDIF
  147.  
  148.     IF GENERATING68K THEN
  149.         _InvalMenuBar:    OPWORD    $A81D
  150.     ELSE
  151.         IMPORT    InvalMenuBar
  152.     ENDIF
  153.  
  154.     IF GENERATING68K THEN
  155.         _DeleteMenu:    OPWORD    $A936
  156.     ELSE
  157.         IMPORT    DeleteMenu
  158.     ENDIF
  159.  
  160.     IF GENERATING68K THEN
  161.         _ClearMenuBar:    OPWORD    $A934
  162.     ELSE
  163.         IMPORT    ClearMenuBar
  164.     ENDIF
  165.  
  166.     IF GENERATING68K THEN
  167.         _GetNewMBar:    OPWORD    $A9C0
  168.     ELSE
  169.         IMPORT    GetNewMBar
  170.     ENDIF
  171.  
  172.     IF GENERATING68K THEN
  173.         _GetMenuBar:    OPWORD    $A93B
  174.     ELSE
  175.         IMPORT    GetMenuBar
  176.     ENDIF
  177.  
  178.     IF GENERATING68K THEN
  179.         _SetMenuBar:    OPWORD    $A93C
  180.     ELSE
  181.         IMPORT    SetMenuBar
  182.     ENDIF
  183.  
  184.     IF GENERATING68K THEN
  185.         _InsertMenuItem:    OPWORD    $A826
  186.     ELSE
  187.         IMPORT    InsertMenuItem
  188.     ENDIF
  189.  
  190.     IF GENERATING68K THEN
  191.         _DeleteMenuItem:    OPWORD    $A952
  192.     ELSE
  193.         IMPORT    DeleteMenuItem
  194.     ENDIF
  195.  
  196.     IF GENERATING68K THEN
  197.         _MenuKey:    OPWORD    $A93E
  198.     ELSE
  199.         IMPORT    MenuKey
  200.     ENDIF
  201.  
  202.     IF GENERATING68K THEN
  203.         _HiliteMenu:    OPWORD    $A938
  204.     ELSE
  205.         IMPORT    HiliteMenu
  206.     ENDIF
  207.  
  208.     IF GENERATING68K THEN
  209.         _SetMenuItemText:    OPWORD    $A947
  210.     ELSE
  211.         IMPORT    SetMenuItemText
  212.     ENDIF
  213.  
  214.     IF GENERATING68K THEN
  215.         _GetMenuItemText:    OPWORD    $A946
  216.     ELSE
  217.         IMPORT    GetMenuItemText
  218.     ENDIF
  219.  
  220.     IF GENERATING68K THEN
  221.         _DisableItem:    OPWORD    $A93A
  222.     ELSE
  223.         IMPORT    DisableItem
  224.     ENDIF
  225.  
  226.     IF GENERATING68K THEN
  227.         _EnableItem:    OPWORD    $A939
  228.     ELSE
  229.         IMPORT    EnableItem
  230.     ENDIF
  231.  
  232.     IF GENERATING68K THEN
  233.         _CheckItem:    OPWORD    $A945
  234.     ELSE
  235.         IMPORT    CheckItem
  236.     ENDIF
  237.  
  238.     IF GENERATING68K THEN
  239.         _SetItemMark:    OPWORD    $A944
  240.     ELSE
  241.         IMPORT    SetItemMark
  242.     ENDIF
  243.  
  244.     IF GENERATING68K THEN
  245.         _GetItemMark:    OPWORD    $A943
  246.     ELSE
  247.         IMPORT    GetItemMark
  248.     ENDIF
  249.  
  250.     IF GENERATING68K THEN
  251.         _SetItemIcon:    OPWORD    $A940
  252.     ELSE
  253.         IMPORT    SetItemIcon
  254.     ENDIF
  255.  
  256.     IF GENERATING68K THEN
  257.         _GetItemIcon:    OPWORD    $A93F
  258.     ELSE
  259.         IMPORT    GetItemIcon
  260.     ENDIF
  261.  
  262.     IF GENERATING68K THEN
  263.         _SetItemStyle:    OPWORD    $A942
  264.     ELSE
  265.         IMPORT    SetItemStyle
  266.     ENDIF
  267.  
  268.     IF GENERATING68K THEN
  269.         _CalcMenuSize:    OPWORD    $A948
  270.     ELSE
  271.         IMPORT    CalcMenuSize
  272.     ENDIF
  273.  
  274.     IF GENERATING68K THEN
  275.         _CountMItems:    OPWORD    $A950
  276.     ELSE
  277.         IMPORT    CountMItems
  278.     ENDIF
  279.  
  280.     IF GENERATING68K THEN
  281.         _GetMenuHandle:    OPWORD    $A949
  282.     ELSE
  283.         IMPORT    GetMenuHandle
  284.     ENDIF
  285.  
  286.     IF GENERATING68K THEN
  287.         _FlashMenuBar:    OPWORD    $A94C
  288.     ELSE
  289.         IMPORT    FlashMenuBar
  290.     ENDIF
  291.  
  292.     IF GENERATING68K THEN
  293.         _SetMenuFlash:    OPWORD    $A94A
  294.     ELSE
  295.         IMPORT    SetMenuFlash
  296.     ENDIF
  297.  
  298.     IF GENERATING68K THEN
  299.         _MenuSelect:    OPWORD    $A93D
  300.     ELSE
  301.         IMPORT    MenuSelect
  302.     ENDIF
  303.  
  304.     IF GENERATING68K THEN
  305.         _InitProcMenu:    OPWORD    $A808
  306.     ELSE
  307.         IMPORT    InitProcMenu
  308.     ENDIF
  309.  
  310.     IF GENERATING68K THEN
  311.         _GetItemCmd:    OPWORD    $A84E
  312.     ELSE
  313.         IMPORT    GetItemCmd
  314.     ENDIF
  315.  
  316.     IF GENERATING68K THEN
  317.         _SetItemCmd:    OPWORD    $A84F
  318.     ELSE
  319.         IMPORT    SetItemCmd
  320.     ENDIF
  321.  
  322.     IF GENERATING68K THEN
  323.         _PopUpMenuSelect:    OPWORD    $A80B
  324.     ELSE
  325.         IMPORT    PopUpMenuSelect
  326.     ENDIF
  327.  
  328.     IF GENERATING68K THEN
  329.         _MenuChoice:    OPWORD    $AA66
  330.     ELSE
  331.         IMPORT    MenuChoice
  332.     ENDIF
  333.  
  334.     IF GENERATING68K THEN
  335.         _DeleteMCEntries:    OPWORD    $AA60
  336.     ELSE
  337.         IMPORT    DeleteMCEntries
  338.     ENDIF
  339.  
  340.     IF GENERATING68K THEN
  341.         _GetMCInfo:    OPWORD    $AA61
  342.     ELSE
  343.         IMPORT    GetMCInfo
  344.     ENDIF
  345.  
  346.     IF GENERATING68K THEN
  347.         _SetMCInfo:    OPWORD    $AA62
  348.     ELSE
  349.         IMPORT    SetMCInfo
  350.     ENDIF
  351.  
  352.     IF GENERATING68K THEN
  353.         _DisposeMCInfo:    OPWORD    $AA63
  354.     ELSE
  355.         IMPORT    DisposeMCInfo
  356.     ENDIF
  357.  
  358.     IF GENERATING68K THEN
  359.         _GetMCEntry:    OPWORD    $AA64
  360.     ELSE
  361.         IMPORT    GetMCEntry
  362.     ENDIF
  363.  
  364.     IF GENERATING68K THEN
  365.         _SetMCEntries:    OPWORD    $AA65
  366.     ELSE
  367.         IMPORT    SetMCEntries
  368.     ENDIF
  369.  
  370.     IF GENERATING68K THEN
  371.         Macro
  372.         _InsertFontResMenu
  373.             move.w    #$0400,d0
  374.             dc.w     $A825
  375.         EndM
  376.     ELSE
  377.         IMPORT    InsertFontResMenu
  378.     ENDIF
  379.  
  380.     IF GENERATING68K THEN
  381.         Macro
  382.         _InsertIntlResMenu
  383.             move.w    #$0601,d0
  384.             dc.w     $A825
  385.         EndM
  386.     ELSE
  387.         IMPORT    InsertIntlResMenu
  388.     ENDIF
  389.  
  390.     IF GENERATING68K THEN
  391.         _SystemEdit:    OPWORD    $A9C2
  392.     ELSE
  393.         IMPORT    SystemEdit
  394.     ENDIF
  395.  
  396.     IF GENERATING68K THEN
  397.         _SystemMenu:    OPWORD    $A9B5
  398.     ELSE
  399.         IMPORT    SystemMenu
  400.     ENDIF
  401.  
  402.     IF OLDROUTINENAMES  THEN
  403.     ENDIF
  404.     ENDIF ; __MENUS__
  405.